package com.zxq.iot.tcp.modbus.frame;

import com.zxq.factory.annotate.DecoderField;
import com.zxq.factory.annotate.EncoderField;
import com.zxq.factory.annotate.Frame;
import com.zxq.factory.enums.EField;
import com.zxq.factory.enums.ETrimMethod;
import com.zxq.iot.tcp.modbus.frame.inner.PDU;
import lombok.Data;

@Frame(id = 2L,remark = "传感器协议")
@Data
public class TcpModBusFrame {


    @EncoderField(sequence = 1,note = "事务标识")
    @DecoderField(sequence = 1,note = "事务标识" )
    Integer transactionId;

    @EncoderField(sequence = 2,note = "协议标识")
    @DecoderField(sequence = 2,note = "协议标识" )
    Integer protocolId;

    @EncoderField(sequence = 3,note = "数据长度")
    @DecoderField(sequence = 3,note = "数据长度" )
    Integer length;

    @EncoderField(sequence = 4,field = EField.Frame,note = "数据长度")
    @DecoderField(sequence = 4,field = EField.Frame,method = ETrimMethod.Tail,param = 0, note = "数据长度" )
    PDU pdu;


}
